<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>私聊 - {{ target_user }}</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <div class="chat-container private-chat">
        <!-- 主聊天区域 -->
        <div class="chat-main">
            <div class="chat-header">
                <div class="chat-header-info">
                    <h1>{{ target_user }}</h1>
                    <span class="online-status">在线</span>
                </div>
                <div class="header-actions">
                    <button class="btn" onclick="window.location.href='/'">返回公共聊天</button>
                </div>
            </div>
            
            <div class="messages-container" id="messages-container">
                <div class="load-more">
                    <button onclick="chatManager.loadMoreMessages()">加载更多消息</button>
                </div>
                <!-- 消息内容将在这里动态生成 -->
            </div>
            
            <div class="input-area">
                <textarea id="message-input" placeholder="输入消息..." rows="1"></textarea>
                <button class="send-btn" onclick="chatManager.sendMessage()">发送</button>
            </div>
        </div>

        <!-- 文件面板 -->
        <div class="file-panel">
            <h3>文件传输</h3>
            <div class="file-upload">
                <input type="file" id="file-input" style="display: none">
                <button class="btn" onclick="document.getElementById('file-input').click()">选择文件</button>
                <button class="btn" id="upload-btn" onclick="fileHandler.uploadFile()" disabled>上传</button>
            </div>
            <div id="upload-progress" style="display: none">
                <div class="progress-bar">
                    <div class="progress" id="progress-value"></div>
                </div>
            </div>
            <div class="file-list" id="file-list">
                <!-- 文件列表将在这里动态生成 -->
            </div>
        </div>
    </div>

    <script>
        // 设置私聊目标用户
        window.targetUser = "{{ target_user }}";
    </script>
    <script src="{{ url_for('static', filename='js/chat.js') }}"></script>
    <script src="{{ url_for('static', filename='js/file-handler.js') }}"></script>
</body>
</html> 